-
-
Notifications
You must be signed in to change notification settings - Fork 73
feat: Android litert version bump and 16KB page support #146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Is this written with AI? 😄 Did you test this change if everything runs on both iOS + Android? |
Parts of the gradle step were AI generated and then refined by myself. I tested on Android with the app I am working on and the ML model I am using was still working correctly. |
Not working for me. ERROR TypeError: Cannot read property 'install' of undefined, js engine: hermes [Component Stack] |
@jslok were you building off this branch? Did you clean out node_modules, android/build, and android/.gradle folders. |
Yep I tried this PR. Just tried again with full reinstall and gradle clean and same error. Also tried with a new clean project and got the same error. Using react-native 0.75.5 no expo no new arch. |
Just FYI, Google Play Console complains about some additional libs at my end as well. Here is the full list:
I'm not using vision camera lib in my project. |
Tested on rn 0.81.4, rn cli, with new arch and getting the same errors |
Any update on this? Or when can this PR be merged? |
@coderof19clc7 it's open source. I laid out all the thought process in this PR. It worked in my case and the project I was working on. You can examine it and adapt it to your use case. jslok was saying that there were issues, so maybe start by digging in and seeing if you can recreate those issues. |
@andrew-schenk , thanks for your reply, I was waiting for the merge but I will try to adapt your changes first then. |
This PR fixes an issue where the Google Play Store would complain that this library was bundling non 16KB page aligned .so files.
Specifically
v1.4.0 of the litert fixes that without requiring a major update to v2.
google-ai-edge/LiteRT#43
Simply updating the dependency version wasn't enough because the directory structure of litert changes from 1.0.1 to 1.4.0
You can see that by going to maven and downloading and unzipping the 1.0.1 AAR and 1.4.0 AAR.
1.0.1 directory structure
headers/
--tensorflow/
----lite/
1.4.0 directory structure
headers/
--external/
----org_tensorflow/
----tensorflow/
--tflite/
This change in directory structure requires updated imports in this projects cpp files. from
#include <tensorflow/lite
to#include <tflite
There was also an issue with the internal litert cpp files not linking correctly because of the extra
external/org_tensorflow/tensorflow
path and the way this project copies over header files. I modified the gradle script to copytensorflow
up two levelsso this: turns into
headers/
--external/
----org_tensorflow/
----tensorflow/
--tflite/
this
headers/
--tensorflow/
--tflite/